package com.zte.common.control;

import com.zte.common.service.CommonPronvinceService;
import com.zte.util.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CacheConfig(cacheNames = "commonProvince")
@RequestMapping("/commonProvince")
public class CommonProvinceAction {
    @Autowired
    private CommonPronvinceService commonPronvinceService;
    //获取所有省份城市信息
    @GetMapping
    @Cacheable
    public ResultMessage getAllProvince(){
        return new ResultMessage(200,true,"success", commonPronvinceService.getAllProvince());
    }
}
